package net.lainiao.workqueuefair;

import com.rabbitmq.client.Channel;
import net.lainiao.MyConst;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * Created by Administrator on 2018/7/9.
 */
public class ProviderDemo {
    public static void main(String[] args) throws IOException, TimeoutException {
        Channel channel =MyConst.getChanel();
        channel.queueDeclare(MyConst.QName,false,false,false,null);
        channel.basicQos(1);
        for (int i = 0; i <5000 ; i++) {
            String mess="消息"+i;
            channel.basicPublish("",MyConst.QName,null,mess.getBytes());
        }
        channel.close();
        MyConst.connection.close();
    }
}
